from typing import List
from collections import defaultdict
class Solution:
    def maxPoints(self, points: List[List[int]]) -> int:
        n = len(points)
        points_hash = defaultdict(set)
        for i in range(n):
            for j in range(i):
                x1, y1 = points[i]
                x2, y2 = points[j]
                if x1 == x2:
                    feature = f"x={x1}"
                else:
                    k = (y1 - y2) / (x1 - x2)
                    b = y1 - k * x1
                    feature = f"y={k}x+{b}"
                points_hash[feature].add(tuple(points[i]))
                points_hash[feature].add(tuple(points[j]))
        ans = 0
        for val in points_hash.values():
            ans = max(ans, val.__len__())
        return ans
if __name__ == '__main__':
    s = Solution()
    r = s.maxPoints( [[1,1],[2,2],[3,3]])
    print(r)